package cn.qin.Actions;

import org.apache.struts2.json.annotations.JSON;
import org.json.JSONException;

import net.sf.json.JSONArray;
import cn.qin.DAO.impl.newsOperateDAOimpl;
import cn.qin.Models.NEWS;
import cn.qin.Services.newsServices;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class showNewsAction extends ActionSupport {
	NEWS news = new NEWS();
	//newsOperateDAOimpl  newsoperatedaoimpl =new newsOperateDAOimpl();
	newsServices newsservices = new newsServices();
	JSONArray JSON = new JSONArray();

	public String execute() {
		return Action.SUCCESS;
	}
	
	@JSON(name="news")
	public JSONArray getJSON() throws JSONException {
		System.out.println("showNewsAction:public JSONArray getJSON()");
		return newsservices.showNews(news);	
	}
	public void setJSON(JSONArray jSON) {
		this.JSON = jSON;
	}


	
}
